package billing.utils.rmi;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import billing.system.SystemConfigCenter;

public class MysqlTools {

	static String userName = SystemConfigCenter.get("billing.utils.rmi.MysqlTools.userName", "root");
	static String password = SystemConfigCenter.get("billing.utils.rmi.MysqlTools.password","billing");
	static String driver = SystemConfigCenter.get("billing.utils.rmi.MysqlTools.driver","com.mysql.jdbc.Driver");
	static String connUrl = SystemConfigCenter.get("billing.utils.rmi.MysqlTools.connUrl","jdbc:mysql://127.0.0.1:3306/test");
	static Connection conn = null;
	static {
		try {
			Class.forName(driver);
			conn = DriverManager.getConnection(connUrl, userName, password);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	public static Connection getConn() {
		return conn;
	}
}
